import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch((err) => err)
}

const routes = [
	{
		path: '/report',
		name: 'Report',
		component: () => import('../views/report/Report.vue')
	},
	{
		path: '/log',
		name: 'Log',
		component: () => import('../views/log/Log.vue')
	},
	{
		path: '/index',
		name: 'Index',
		component: () => import('../views/fire/index.vue'),
		redirect: '/fire',
		children: [
			{
				//火情主页面
				path: '/fire',
				name: 'Fire',
				component: () => import('../views/fire/Fire.vue')
			},
			// {
			// 	path: '/screen',
			// 	name: 'Screen',
			// 	component: () => import('../views/fire/Screen.vue')
			// },
			{
				// 火情反馈
				path: '/couple',
				name: 'Couple',
				component: () => import('../views/fire/Couple.vue')
			},
			{
				// 火情简报
				path: '/bulletin',
				name: 'Bulletin',
				component: () => import('../views/fire/Bulletin.vue')
			}
			// {
			// 	path: '/dispose',
			// 	name: 'Dispose',
			// 	component: () => import('../views/fire/Dispose.vue')
			// },
			// {
			// 	path: '/edit',
			// 	name: 'Edit',
			// 	component: () => import('../views/fire/Edit.vue')
			// }
		]
	}
]

const router = new VueRouter({
	routes
})

export default router
